<?php

/*
* @package Joomla Google Plus One Module 1.1.0 for Joomla 1.5 from rndm-snippets.blogspot.com
* @author Stephan Schmidt
* @copyright Copyright (C) 2011 rndm-snippets.blogspot.com All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see license.txt
* Joomla! is free software.
* This extension is made for Joomla! 1.5;

** THE BEST CMS : JOOMLA! **
*/

defined( '_JEXEC' ) or die( 'Restricted access' );
	$gpluscss = $params->get('j_gplus_css');
	$gplussize = $params->get('j_gplus_size');
	$gplushref = $params->get('j_gplus_href');
	$gpluscount = $params->get('j_gplus_count');
	
	$ip_safe = 1;
	$document = JFactory::getDocument();
	$css =".twitter-follow iframe{width:200px!important;}";
	$document->addStyleDeclaration($css);
?>
<div style="<?php echo $gpluscss;?>" class="twitter-follow" >
<a href="https://twitter.com/mlninfo" class="twitter-follow-button" data-button="grey" data-text-color="#FFFFFF" data-link-color="#00AEFF">Follow @mlninfo</a>
<script src="//platform.twitter.com/widgets.js" type="text/javascript"></script>
</div>
<?php
	if ($ip_safe) {
		if ($gpluscss) { 
			echo "<div style=\"" . $gpluscss . "\">\r\n"; 
		}
		echo "<script type=\"text/javascript\" src=\"http://apis.google.com/js/plusone.js\"></script>";
		echo "<g:plusone";
		
		/* add attributes */
		
		//button size
		if($gplussize=="small"){
			echo " size=\"small\"";
		} else if ($gplussize=="medium") {
			echo " size=\"medium\"";
		} else if ($gplussize=="tall") {
			echo " size=\"tall\"";
		} 
		
		//target url
		if($gplushref!=""){
			echo " href=\"".$gplushref."\"";
		}
		
		//show total count
		if($gpluscount=="0"){
			echo " count=\"true\"";
		} else {
			echo " count=\"false\"";
		} 
			
		echo "></g:plusone>";
		if ($gpluscss) { 
			echo '</div>'; 
		}
	} 
	else {
		echo '<div style="float: none; margin: 0px 0px 0px 0px;">' . $params->get('ip_block_alt_code') . '</div>';
	}
?>

<div class='clear'></div>